//
//  UIView+Frame.m
//  BLOCK 播放按钮
//
//  Created by 岁变 on 16/8/19.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

// 原点的x
// set方法
- (void)setXY_x:(CGFloat)XY_x {
    
    CGRect rect = self.frame;
    rect.origin.x = XY_x;
    self.frame = rect;
}
// get方法
- (CGFloat)XY_x {
    
    return self.frame.origin.x;
}

// 原点的y
// set方法
- (void)setXY_y:(CGFloat)XY_y {
    
    CGRect rect = self.frame;
    rect.origin.y = XY_y;
    self.frame = rect;
}
// get方法
- (CGFloat)XY_y {
    
    return self.frame.origin.y;
}
// view的width
// set方法
- (void)setXY_width:(CGFloat)XY_width {
    
    CGRect rect = self.frame;
    rect.size.width = XY_width;
    self.frame = rect;
}
// get方法
- (CGFloat)XY_width {
    
    return self.frame.size.width;
}
// view的height
// set方法
- (void)setXY_height:(CGFloat)XY_height {
    
    CGRect rect = self.frame;
    rect.size.height = XY_height;
    self.frame = rect;
}
// get方法
- (CGFloat)XY_height {
    
    return self.frame.size.height;
}


-(void)setXY_center_x:(CGFloat)XY_center_x {
    CGPoint center = self.center;
    center.x = XY_center_x;
    self.center = center;
}
- (CGFloat)XY_center_x {
    return self.center.x;
}
- (void)setXY_center_y:(CGFloat)XY_center_y {
    CGPoint center = self.center;
    center.y = XY_center_y;
    self.center = center;
}
- (CGFloat)XY_center_y {
    return self.center.y;
}


@end
